package manager

import (
	"github.com/gin-gonic/gin"
	"net/http"
	"one-wiki/commons"
	"one-wiki/logic"
)

func ManagerHandlersInit(engine *gin.Engine) {
	// 用户登录
	engine.POST("/manger/user", userList)
}

func userList(context *gin.Context) {
	var form commons.UserRegisterRequest
	if err := context.ShouldBindJSON(&form); err != nil {
		panic(commons.CustomClientError("参数异常"))
	}
	context.JSON(http.StatusOK, logic.Register(form))
}
